/*!
 * TidyBlog 2.0
 * Express navigator - v1.0.0 (2013-10-07T10:25:24+800)
 * https://code.google.com/p/tidyblog/ | Released under MIT license
 */
define(function(require, exports, module) { 'use strict';

var $ = require('dom/1.0.x/');


var expressNav = $('#express-nav'),
	currentPosition = $('#current-position'),
	visible = false;

function show() {
	currentPosition.addClass('expanded');
	expressNav.animate({
		opacity: 1,
		display: 'block'
	});
	visible = true;
}

function hide() {
	currentPosition.removeClass('expanded');
	expressNav.animate({
		opacity: 0,
		display: 'none'
	});
	visible = false;
}

function toggle() {
	if (visible) {
		hide();
	} else {
		show();
	}
}

expressNav.mouseleave(function() {
	hide();
});
currentPosition.click(function(e) {
	toggle();
	e.stopPropagation();
})
$('body').click(function() { hide(); });


return {
	show: show,
	hide: hide,
	toggle: toggle
};

});